package cn.bugstack.springframework.context.support;

import cn.bugstack.springframework.beans.BeansException;

import cn.bugstack.springframework.beans.factory.support.DefaultListableBeanFactory;
import cn.bugstack.springframework.beans.factory.xml.XmlBeanDefinitionReader;


/**
 * @param
 * @author oyz
 * @version 1.1.0
 * @description: TODO
 * @date 2022-8-24 15:25
 */
public abstract class AbStractXmlApplicationContext extends AbStractRefreshableApplicationContext{




    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws BeansException {
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if(null != configLocations){
            reader.loadBeanDefinitions(configLocations);
        }
    }

    protected abstract String[] getConfigLocations();


}
